﻿<!---------------------------------------------------------------------------------------------------
TEMPLATE: Validation (xrmControlValidationMessage)
---------------------------------------------------------------------------------------------------->
<script id="xrmControlValidationMessage" type="text/html">
    <div style="display: none" data-bind="validationElement: field, validationOptions: { errorElementClass: 'sparkle-control-error-element', decorateElement: true }">
        <img src="../../sparkle_/css/images/transparent_spacer.gif" alt="Error" class="sparkle-imagestrip-inlineedit_warning">
        <span class="sparkle-control-validation-text" data-bind="validationMessage: field" />
    </div>
</script>

<!---------------------------------------------------------------------------------------------------
TEMPLATE:  Please Wait Block
---------------------------------------------------------------------------------------------------->
<script id="xrmPleaseWaitBlock" type="text/html">
    <div class="sparkle-wait-blockout" data-bind="fadeVisible: isBusy">
        <table height="100%" width="100%">
            <tr>
                <td align="center" valign="middle">
                    <img src="../../sparkle_/css/images/transparent_spacer.gif" />
                    <div id="progressbar" style="width: 200px" data-bind="progressBar: isBusyProgress, visible: isBusyProgress != null"></div>
                    <div class="progress-label" data-bind="text: isBusyMessage"></div>
                </td>
            </tr>
        </table>
    </div>
</script>
<!---------------------------------------------------------------------------------------------------
TEMPLATE: Tab Header (sparkle-form-tab-header)
---------------------------------------------------------------------------------------------------->
<script type="text/html" id="sparkle-form-tab-header">
    <table cellspacing="0" cellpadding="0" class="sparkle-InlineTabHeader sparkle-InlineTabBorder">
        <tbody>
            <tr>
                <td class="sparkle-InlineTabHeaderExpander">
                    <img src="../../sparkle_/css/images/transparent_spacer.gif" class="sparkle-InlineTabExpander sparkle-imagestrip-tab_down">
                </td>
                <td class="sparkle-InlineTabHeaderText">
                    <h2 class="sparkle-Form">
                        <span data-bind="text: title"></span>
                    </h2>
                </td>
            </tr>
        </tbody>
    </table>
</script>

<!---------------------------------------------------------------------------------------------------
TEMPLATE: Field (sparkle-form-field)
---------------------------------------------------------------------------------------------------->
<script type="text/html" id="sparkle-form-field">
    <td class="sparkle-FieldLabel-LeftAlign FormSection_CellPadding sparkle-Field-Required">
        <div data-bind="visible: visible">
            <label data-bind="text: label">
            </label>
            <!--ko if:required=='2'-->
            <img alt="Required" src="../../sparkle_/css/images/transparent_spacer.gif" class="sparkle-imagestrip-frm_required"><!--/ko-->
        </div>
    </td>
    <td style="overflow: hidden;">
        <!--ko if:type=='text'-->
        <div class="sparkle-input-Container" data-bind="xrmtextbox: field, visible: visible">
            <input type="text" maxlength="256" data-bind="disable: disable" class="sparkle-Input sparkle-Text sparkle-input-textbox-part">
        </div>
        <!--/ko-->
        <!--ko if:type=='numeric'-->
        <div class="sparkle-input-Container" data-bind="xrmnumeric: field, minvalue: minvalue, maxvalue: maxvalue, precision: precision, visible: visible">
            <input type="text" maxlength="256" data-bind="disable: disable" class="sparkle-Input sparkle-Text sparkle-input-textbox-part">
        </div>
        <!--/ko-->
        <!--ko if:type=='money'-->
        <div class="sparkle-input-Container" data-bind="xrmmoney: field, minvalue: minvalue, maxvalue: maxvalue, xrmcurrencysymbol: $parent.transactioncurrencyid, visible: visible">
            <table style="width: 100%" cellspacing="0" cellpadding="0" class="sparkle-control-layout-table">
                <tr>
                    <td><span class="sparkle-input-currencyprefix-part"></span></td>
                    <td width="100%">
                        <input type="text" maxlength="256" data-bind="disable: disable" class="sparkle-Input sparkle-Text sparkle-input-textbox-part"></td>
                </tr>
            </table>
        </div>
        <!--/ko-->
        <!--ko if:type=='datetime'-->
        <table style="width: 100%" cellspacing="0" cellpadding="0" class="sparkle-control-layout-table" data-bind="datepicker: field, timeofday: field, visible: visible">
            <tr>
                <td class="sparkle-input-Container">
                    <input type="text" class="sparkle-Input sparkle-input-datepicker-part" data-bind="disable: disable" /></td>
                <td class="sparkle-input-datepicker-button sparkle-input-button-margin-after">
                    <input type="button" class="sparkle-input-datepicker-button-part" data-bind="disable: disable" /></td>
                <td class="sparkle-input-Container" data-bind="validationOptions: { messageTemplate: 'xrmControlValidationMessage2' }">
                    <input type="text" data-bind="disable: disable" class="sparkle-Input sparkle-input-timeofday-part" /></td>
                <td class="sparkle-input-dropdownbutton">
                    <input type="button" data-bind="disable: disable" class="sparkle-input-timeofday-button-part" /></td>
            </tr>
        </table>
        <!--/ko-->
        <!--ko if:type=='lookup'-->
        <table style="width: 100%" cellspacing="0" cellpadding="0" class="sparkle-control-layout-table" data-bind="lookup: field, queryCommand: queryCommand, typeCodeAttribute: typeCodeAttribute, idAttribute: idAttribute, nameAttribute: nameAttribute, visible: visible">
            <tr>
                <td class="sparkle-input-Container">
                    <input data-bind="disable: disable" type="text" class="sparkle-Input sparkle-Text sparkle-input-lookup-part" />
                </td>
                <td class="sparkle-input-lookup">
                    <input data-bind="disable: disable" class="sparkle-input-lookup-button-part" type="button" />
                </td>
        </table>
        <!--/ko-->
        <!--ko if:type=='picklist'-->
        <div data-bind="visible: visible">
            <select data-bind="options: options, optionsText: 'name', value: field, optionsCaption: 'Choose...'"></select>
        </div>
        <!--/ko-->
        <!--ko if:type=='optionset'-->
        <div data-bind="optionset: field, optionSetOptions: { entityLogicalName: entityLogicalName, attributeLogicalName: attributeLogicalName, allowEmpty: allowEmpty }, visible: visible">
            <select style="width:100%" class="sparkle-input-optionset-part" data-bind="disable: disable"></select>
        </div>
        <!--/ko-->
        <!--ko if:type=='duration'-->
        <table style="width: 100%" cellspacing="0" cellpadding="0" class="sparkle-control-layout-table" data-bind="duration: field, visible: visible">
            <tr>
                <td class="sparkle-input-Container">
                    <input type="text" data-bind="disable: disable" class="sparkle-Input sparkle-Text sparkle-input-duration-part" />
                </td>
                <td class="sparkle-input-dropdownbutton">
                    <input class="sparkle-input-duration-button-part" data-bind="disable: disable" type="button" />
                </td>
        </table>
        <!--/ko-->
        <!--ko if:type=='bool'-->
        <input type="checkbox" data-bind="checked: field, disable: disable, visible: visible" class="sparkle-Input sparkle-control-checkbox" />
        <!--/ko-->
        <!--ko if:type=='multiline-text'-->
        <div class="sparkle-input-Container" data-bind="visible: visible">
            <textarea data-bind="value: field, valueUpdate: 'keyup', disable: disable" class="sparkle-Input sparkle-Text" rows="5"></textarea>
        </div>
        <!--/ko-->
    </td>
</script>

